<?php

class Skjb_Office_Spreadsheet_Sheet_Row
{
    public $cells = array();
    
    public function __construct($inCells = null)
    {
        if (is_array($inCells)) {
            foreach ($inCells as $inCell) {
                $this->addCell($inCell);
            }
        }
    }
    
    public function addCell($inCell = null)
    {
        if ($inCell instanceof Skjb_Office_Spreadsheet_Sheet_Row_Cell) {
            $cell = $inCell;
        } elseif ($inCell !== null) {
            $cell = new Skjb_Office_Spreadsheet_Sheet_Row_Cell($inCell);
        } else {
            $cell = new Skjb_Office_Spreadsheet_Sheet_Row_Cell();
        }
        
        $this->cells[] = $cell;
        
        return $cell;
    }
}